home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-30  |  5.4 KB  |  190 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Tuesday, October 4, 1988 at 5:23 PM
  4.     Controls.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc. 1985-1988 
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __CONTROLS__
  15. #define __CONTROLS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #define pushButProc 0
  22. #define checkBoxProc 1
  23. #define radioButProc 2
  24. #define useWFont 8
  25. #define scrollBarProc 16
  26. #define inButton 10
  27. #define inCheckBox 11
  28. #define inUpButton 20
  29. #define inDownButton 21
  30. #define inPageUp 22
  31. #define inPageDown 23
  32. #define inThumb 129
  33.  
  34. /* 
  35. axis constraints for DragGrayRgn call */
  36.  
  37. #define noConstraint 0
  38. #define hAxisOnly 1
  39. #define vAxisOnly 2
  40.  
  41. /* 
  42. control messages */
  43.  
  44. #define drawCntl 0
  45. #define testCntl 1
  46. #define calcCRgns 2
  47. #define initCntl 3
  48. #define dispCntl 4
  49. #define posCntl 5
  50. #define thumbCntl 6
  51. #define dragCntl 7
  52. #define autoTrack 8
  53. #define cFrameColor 0
  54. #define cBodyColor 1
  55. #define cTextColor 2
  56. #define cThumbColor 3
  57.  
  58. struct ControlRecord {
  59.     struct ControlRecord **nextControl;
  60.     WindowPtr contrlOwner;
  61.     Rect contrlRect;
  62.     unsigned char contrlVis;
  63.     unsigned char contrlHilite;
  64.     short contrlValue;
  65.     short contrlMin;
  66.     short contrlMax;
  67.     Handle contrlDefProc;
  68.     Handle contrlData;
  69.     ProcPtr contrlAction;
  70.     long contrlRfCon;
  71.     Str255 contrlTitle;
  72. };
  73.  
  74. #ifndef __cplusplus
  75. typedef struct ControlRecord ControlRecord;
  76. #endif
  77.  
  78. typedef ControlRecord *ControlPtr, **ControlHandle;
  79.  
  80. struct CtlCTab {
  81.     long ccSeed;            /*reserved*/
  82.     short ccRider;          /*see what you have done - reserved*/
  83.     short ctSize;           /*usually 3 for controls*/
  84.     ColorSpec ctTable[4];
  85. };
  86.  
  87. #ifndef __cplusplus
  88. typedef struct CtlCTab CtlCTab;
  89. #endif
  90.  
  91. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  92.  
  93. struct AuxCtlRec {
  94.     Handle acNext;          /*handle to next AuxCtlRec*/
  95.     ControlHandle acOwner;  /*handle for aux record's control*/
  96.     CCTabHandle acCTable;   /*color table for this control*/
  97.     short acFlags;          /*misc flag byte*/
  98.     long acReserved;        /*reserved for use by Apple*/
  99.     long acRefCon;          /*for use by application*/
  100. };
  101.  
  102. #ifndef __cplusplus
  103. typedef struct AuxCtlRec AuxCtlRec;
  104. #endif
  105.  
  106. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHndl;
  107.  
  108. #ifdef __safe_link
  109. extern "C" {
  110. #endif
  111. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  112.     const Str255 title,Boolean visible,short value,short min,short max,short procID,
  113.     long refCon)
  114.     = 0xA954; 
  115. pascal void SetCTitle(ControlHandle theControl,const Str255 title)
  116.     = 0xA95F; 
  117. pascal void GetCTitle(ControlHandle theControl,Str255 title)
  118.     = 0xA95E; 
  119. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  120.     = 0xA9BE; 
  121. pascal void DisposeControl(ControlHandle theControl)
  122.     = 0xA955; 
  123. pascal void KillControls(WindowPtr theWindow)
  124.     = 0xA956; 
  125. pascal void HideControl(ControlHandle theControl)
  126.     = 0xA958; 
  127. pascal void ShowControl(ControlHandle theControl)
  128.     = 0xA957; 
  129. pascal void DrawControls(WindowPtr theWindow)
  130.     = 0xA969; 
  131. pascal void Draw1Control(ControlHandle theControl)
  132.     = 0xA96D; 
  133. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  134.     = 0xA95D; 
  135. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  136.     = 0xA953; 
  137. pascal void MoveControl(ControlHandle theControl,short h,short v)
  138.     = 0xA959; 
  139. pascal void SizeControl(ControlHandle theControl,short w,short h)
  140.     = 0xA95C; 
  141. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  142.     = 0xA963; 
  143. pascal short GetCtlValue(ControlHandle theControl)
  144.     = 0xA960; 
  145. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  146.     = 0xA964; 
  147. pascal short GetCtlMin(ControlHandle theControl)
  148.     = 0xA961; 
  149. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  150.     = 0xA965; 
  151. pascal short GetCtlMax(ControlHandle theControl)
  152.     = 0xA962; 
  153. pascal void SetCRefCon(ControlHandle theControl,long data)
  154.     = 0xA95B; 
  155. pascal long GetCRefCon(ControlHandle theControl)
  156.     = 0xA95A; 
  157. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  158.     = 0xA96B; 
  159. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  160.     = 0xA96A; 
  161. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  162.     const Rect *slopRect,short axis)
  163.     = 0xA967; 
  164. pascal short TestControl(ControlHandle theControl,Point thePt)
  165.     = 0xA966; 
  166. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  167.     = 0xA968; 
  168. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  169.     = 0xA96C; 
  170. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  171.     = 0xAA43; 
  172. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHndl *acHndl)
  173.     = 0xAA44; 
  174. pascal short GetCVariant(ControlHandle theControl)
  175.     = 0xA809; 
  176. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  177.     const Rect *slopRect,short axis); 
  178. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  179.     Boolean visible,short value,short min,short max,short procID,long refCon); 
  180. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  181. void getctitle(ControlHandle theControl,char *title); 
  182. void setctitle(ControlHandle theControl,char *title); 
  183. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  184. short testcontrol(ControlHandle theControl,Point *thePt); 
  185. #ifdef __safe_link
  186. }
  187. #endif
  188.  
  189. #endif
  190.